/***************************************************************************
   Filename:    boxgen.h
   Author:      Josh Partridge
   Description: Contains methods for drawing boxes and enumeration for
                extended ascii set
****************************************************************************/

#ifndef BOXGEN_H_INCLUDED
#define BOXGEN_H_INCLUDED

#include "Brush.h"

enum ExtendedAscii
{
    //single character box
    SSINGLE=(unsigned char)255,
    //single line top left corner
    STOPLEFT=(unsigned char)218,
    STOPRIGHT=(unsigned char)191,
    SBOTTOMLEFT=(unsigned char)192,
    SBOTTOMRIGHT=(unsigned char)217,
    //single horizontal line
    SHORIZ=(unsigned char)196,
    //single wavy horizontal line
    SHORIZWAVY=(unsigned char)126,
    //single horizontal intersecting single vertical line
    SHORIZINTSVERT=(unsigned char)197,
    // single horizontal joining single vertical line on the left
    SHORIZJOINSVERTLEFT=(unsigned char)195,
    SHORIZJOINSVERTRIGHT=(unsigned char)180,
    //single horizontal intersecting double vertical lines
    SHORIZINTDVERT=(unsigned char)(unsigned char)215,
    SHORIZJOINDVERTLEFT=199,
    SHORIZJOINDVERTRIGHT=(unsigned char)182,
    SVERT=(unsigned char)179,
    SVERTJOINSHORIZTOP=(unsigned char)194,
    SVERTJOINSHORIZBOT=(unsigned char)193,
    SVERTJOINDHORIZTOP=(unsigned char)209,
    SVERTJOINDHORIZBOT=(unsigned char)207,
    //single line top loop upside down "U"
    STOPLOOP=(unsigned char)239,
    //single line bottom loop "U"
    SBOTTOMLOOP=(unsigned char)85,
    //double line top left corner
    DTOPLEFT=(unsigned char)201,
    DTOPRIGHT=(unsigned char)187,
    DBOTTOMLEFT=(unsigned char)200,
    DBOTTOMRIGHT=(unsigned char)188,
    //double horizontal line
    DHORIZ=(unsigned char)205,
    DHORIZWAVY=(unsigned char)247,
    //double horizontal intersecting single vertical line
    DHORIZINTSVERT=(unsigned char)216,
    //double horizontal lines joining single vertical line on the left
    DHORIZJOINSVERTLEFT=(unsigned char)198,
    DHORIZJOINSVERTRIGHT=(unsigned char)181,
    //double horizontal lines joining single vertical line for bottom left corner
    DHORZJOINSVERTBOTTOMLEFT=(unsigned char)212,
    //double horizontal lines joining single vertical line for bottom right corner
    DHORZJOINSVERTBOTTOMRIGHT=(unsigned char)190,
    //double horizontal intersecting double vertical
    DHORIZINTDVERT=(unsigned char)206,
    DHORIZJOINDVERTLEFT=(unsigned char)204,
    DHORIZJOINDVERTRIGHT=(unsigned char)185,
    //double vertical lines
    DVERT=(unsigned char)186,
    //double vertical lines joining single horizontal on the top
    DVERTJOINSHORIZTOP=(unsigned char)210,
    DVERTJOINSHORIZBOT=(unsigned char)208,
    DVERTJOINDHORIZTOP=(unsigned char)203,
    DVERTJOINDHORIZBOT=(unsigned char)202,
    //triple horizontal lines
    THORIZ=(unsigned char)240,
    //fancy top left
    FTOPLEFT=(unsigned char)244,
    //fancy top right
    FBOTTOMRIGHT=(unsigned char)245,
    //fancy single horizontantal
    FSINGLEHORIZ=(unsigned char)246,
    //infinity symbol
    FDOULBEHORIZ=(unsigned char)236,
    //currently same as normal triple horizontal
    FTRIPLEHORIZ=(unsigned char)240,
    //fancy wavy 'f', not to be alternated
    FVERTWAVY=(unsigned char)159,
    //double arrow pointing left
    DARROWLEFT=(unsigned char)174,
    DARROWRIGHT=(unsigned char)175,
    //block of low density
    LOWDENSE=(unsigned char)176,
    //block of medium density
    MEDDENSE=(unsigned char)177,
    //block of high density
    HIGHDENSE=(unsigned char)178,
    //solid block
    SOLID=(unsigned char)219,
    //solid block, lower half
    SOLIDLOW=(unsigned char)220,
    //solid block, upper half
    SOLIDUP= (unsigned char)223,
    //solid block, left half
    SOLIDLEFT= (unsigned char)221,
    //solid block, right half
    SOLIDRIGHT= (unsigned char)222,
    //square root symbol, used for jagged horizontal lines
    SQRT=(unsigned char)251
};

/************************************************************************************
Name:               horizFill
Description:        draws various boxes filled in with horizontal lines
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
             lines: int representing horizontal lines per character
              wavy: bool representing of wavy characters should be used
 *************************************************************************************/
void horizFill(Brush& brush, int x, int y, int width, int height, int lines=2, bool wavy=false);

/************************************************************************************
Name:               verticalFill
Description:        draws various boxes filled in with vertical lines
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
             lines: int representing vertical lines per character
              wavy: bool representing of wavy characters should be used
 *************************************************************************************/
void verticalFill(Brush& brush, int x, int y, int width, int height, int lines=1, bool wavy=false);

/************************************************************************************
Name:               fancyFill
Description:        draws various boxes filled in
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
             lines: int representing lines per character
           density: int representing of density of solid fills
 *************************************************************************************/
void fancyFill(Brush& brush, int x, int y, int width, int height, int lines=2, int density=0);

/************************************************************************************
Name:               singleLineBox
Description:        draws a single line width box outline
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
 *************************************************************************************/
void singleLineBox(Brush&, int x, int y, int width, int height);

/************************************************************************************
Name:               singleLineBox (overloaded)
Description:        draws a single line width box outline
Input:
             brush: reference to a Brush
                tl: COORD representing top left coordinates
                br: COORD representing bottom right coordinates
*************************************************************************************/
void singleLineBox(Brush&, COORD tl, COORD br);

/************************************************************************************
Name:               doubleLineBox
Description:        draws a double line width box outline
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
 *************************************************************************************/
void doubleLineBox(Brush&, int x, int y, int width, int height);

/************************************************************************************
Name:               doubleLineBox (overloaded)
Description:        draws a double line width box outline
Input:
             brush: reference to a Brush
                tl: COORD representing top left coordinates
                br: COORD representing bottom right coordinates
*************************************************************************************/
void doubleLineBox(Brush&, COORD tl, COORD br);

/************************************************************************************
Name:               fancyBox
Description:        draws various fancy box outlines
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
              wavy: bool representing of wavy characters should be used
           extreme: bool representing "extreme" mode (different characters)
 *************************************************************************************/
void fancyBox(Brush&, int x, int y, int width, int height, bool wavy=false, bool extreme=false);

/************************************************************************************
Name:               doubleFancyBox
Description:        draws various double line fancy box outlines
Input:
             brush: reference to a Brush
                 x: int representing x position of left side
                 y: int representing y position of top side
             width: int representing width of the box
            height: int representing height of the box
              wavy: bool representing of wavy characters should be used
 *************************************************************************************/
void doubleFancyBox(Brush&, int x, int y, int width, int height, bool wavy=false);

#endif // BOXGEN_H_INCLUDED
